﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="FamilySearch.aspx.cs" Inherits="ES_Project.Pages.WebForm16" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            width: 100%;
        }
        .style3
        {
    }
        .style4
        {
            width: 268px;
        }
        .style5
        {
            width: 125px;
        }
        .style6
        {
            TEXT-ALIGN: right;
            width: 125px;
        }
        .style7
        {
            width: 187px;
        }
        .style8
        {
            TEXT-ALIGN: right;
            width: 187px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link type="text/css" href="js/js/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />	
<link type="text/css" href="js/js/css/jquery.timeentry.css" rel="stylesheet" />
  <script type="text/javascript" src="js/js/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-1.8.10.offset.datepicker.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.datepick-th.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-timepicker-addon.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.pack.js"></script>

   <style type="text/css">
        

/* Overide css code กำหนดความกว้างของปฏิทินและอื่นๆ */ 
.ui-datepicker{

	width:190px;

	font-family:tahoma;

	font-size:11px;

	text-align:center;

}
/* css for timepicker */
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
</style>
   
    <p>
        <br />
    </p>
     <SCRIPT type=text/javascript>
         function getFormattedDate(date) {
             var day = date.getDate();
             var month = date.getMonth() + 1;
             var year = date.getFullYear().toString().slice(2);
             return day + '-' + month + '-' + year;
         }
       

       

         //-->

				</SCRIPT>
    <script type="text/javascript">
        $(function BindEvents() {
            var dateBefore = null;

            $("#ContentPlaceHolder1_TextBox4").datepicker({


                showOn: 'button',
                isBuddhist: true,
                buttonImage: 'images/formcal.gif',
                buttonImageOnly: true
            });

        });</script>
        
         <script type="text/javascript">
             $(function BindEvents2() {
                 var dateBefore = null;

                 $("#ContentPlaceHolder1_TextBox5").datepicker({


                     showOn: 'button',
                     isBuddhist: true,
                     buttonImage: 'images/formcal.gif',
                     buttonImageOnly: true
                 });

             });</script>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>
       
   
    <table cellpadding="0" cellspacing="0" class="style2">
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0" class="style2">
                    <tr>
                        <td class="style3">
                            &nbsp;</td>
                        <td>
                            <strong>ค้นหาครอบครัว</strong></td>
                    </tr>
                    <tr>
                        <td class="style3" colspan="2">
                     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate> 
                                    <table cellpadding="0" cellspacing="0" class="style2">
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong style="text-align: right">รหัสครอบครัว :</strong></td>
                                            <td class="style4">
                                                <strong>
                                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                                </strong>
                                               
                                            </td>
                                            <td class="style6">
                                                <strong>ชื่อครอบครัว :</strong></td>
                                            <td>
                                                <asp:Label ID="Label1" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>รหัสนักเรียน :</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                                               
                                            </td>
                                            <td class="style6">
                                                <strong>ชื่อนักเรียน :</strong></td>
                                            <td>
                                                <asp:Label ID="Label2" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>วันที่สมัครเรียน :</strong></td>
                                            <td class="style4">
                                              <script type="text/javascript">
                                                  Sys.Application.add_load(BindEvents); </script>
                                                <asp:TextBox ID="TextBox4" runat="server" onkeypress="getDate(this)" onChange="dateChang()"></asp:TextBox>
                                            </td>
                                            <td class="style6">
                                                <strong>ถึง&nbsp;&nbsp; วันที่สมัครเรียน :</strong></td>
                                            <td>
                                              <script type="text/javascript">
                                                  Sys.Application.add_load(BindEvents2); </script>
                                                <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="ค้นหา" 
                                                    Width="60px" Height="26px" />
                                                &nbsp;<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="เคลียร์" 
                                                    Width="60px" />
                                            </td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style7">
                                                &nbsp;</td>
                                            <td class="style4">
                                                &nbsp;</td>
                                            <td class="style5">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                <asp:GridView ID="GridView1" runat="server" border="1" CellPadding="4" AutoGenerateColumns="False"
                                                    ForeColor="#333333" GridLines="None" onRowDataBound="GridView1_RowDataBound" 
                                                    Width="100%">
                                                    <AlternatingRowStyle BackColor="White" />
                                                    <Columns>
                                                      <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                              <HeaderTemplate>
                                                  ลำดับ
                                              </HeaderTemplate>
                                              <ItemTemplate>
                                                  <%#Container.DataItemIndex+1 %>
                                              </ItemTemplate>
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="รหัสครอบครัว">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="family_code" runat="server" Text='<%# Eval("family_code") %>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                               <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="ชื่อครอบครัว">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="family_name" runat="server" Text='<%# Eval("family_name") %>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                               <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="left" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="รหัสนักเรียน">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="st_code" runat="server" Text='<%# Eval("st_code") %>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                               <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="ชื่อนักเรียน">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="st_name" runat="server" Text='<%# Eval("st_name") %>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                               <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="left" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="วันที่สมัครเรียน">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="register_date" runat="server" Text='<%# string.Format("{0:dd/MM/yyyy}", Eval("register_date")) %>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                               <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <EditRowStyle BackColor="#2461BF" />
                                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EFF3FB" />
                                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                            </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
   
<script type="text/javascript">
    function dateChang() {

        document.getElementById("ContentPlaceHolder1_TextBox5").value = document.getElementById("ContentPlaceHolder1_TextBox4").value;
        
    }
    
    </script>

      <script type="text/javascript">
          function openW(a) {


              var value1 = a
              emailwindow = dhtmlmodal.open('EmailBox', 'iframe', value1, '', 'width=1350px,height=535px,center=1,resize=0,scrolling=0')

              emailwindow.onclose = function () {
                  return true
              }


          }
        
</script>
</asp:Content>
